package com.zhiwang.xiaoqu.di.component

import android.app.Application
import android.content.Context
import android.content.SharedPreferences
import com.google.gson.Gson
import com.zhiwang.xiaoqu.App
import com.zhiwang.xiaoqu.di.module.ActivityBindModule
import com.zhiwang.xiaoqu.di.module.AppModule
import com.zhiwang.xiaoqu.di.module.MainFragmentBindModule
import com.zhiwang.xiaoqu.mvp.model.RestApi
import com.zhiwang.xiaoqu.mvp.model.room.AppDataBase
import com.zhiwang.xiaoqu.viewmodel.NetWorkViewModel
import dagger.Component
import dagger.android.support.AndroidSupportInjectionModule
import javax.inject.Singleton

@Singleton
@Component(
    modules = [
        AppModule::class,
        AndroidSupportInjectionModule::class,
        ActivityBindModule::class]
)
interface AppComponent {

    fun inject(app: App)

    fun appDatabase(): AppDataBase


    fun app(): Application

    fun appContext(): Context

    fun networkViewModel(): NetWorkViewModel

//    fun userViewModel():UserViewModel

    fun gson(): Gson

    fun restApi(): RestApi

    fun sharePref(): SharedPreferences

}